<%--
  Created by IntelliJ IDEA.
  User: WheelChen
  Date: 2017/4/16
  Time: 18:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/global.css">
    <link rel="stylesheet" href="../../static/css/table.css">
</head>
<div style="margin: 15px;" id="Vue" v-cloak>

    <div v-show="show">
        <blockquote class="layui-elem-quote">
            <a href="/teacher/addrecruitinfo" class="layui-btn layui-btn-small">
                <i class="layui-icon">&#xe608;</i> 添加
            </a>
            <a href="#" class="layui-btn layui-btn-small" @click="myRecruit">我的招聘</a>
            <a href="#" class="layui-btn layui-btn-small" @click="allRecruit">学院招聘</a>
            <%--<a href="#" class="layui-btn layui-btn-small" id="detelBatch">--%>
            <%--<i class="layui-icon">&#x1006;</i> 批量删除--%>
            <%--</a>--%>
            <%--<a href="#" class="layui-btn layui-btn-small" id="edit">--%>
            <%--<i class="layui-icon">&#xe642;</i> 修改--%>
            <%--</a>--%>
            <div style="float: right;">
                <input type="text" id="searchVal">
                <a href="javascript:;" class="layui-btn layui-btn-small" @click="search">
                    <i class="layui-icon">&#xe615;</i> 查询
                </a>
            </div>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>招聘信息</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <%--<th style="width: 30px;"><input  type="checkbox" lay-filter="allselector" lay-skin="primary"></th>--%>
                        <th>类型</th>
                        <th>标题</th>
                        <th>岗位类别</th>
                        <th>招聘人数</th>
                        <th>状态</th>
                        <th>发布日期</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>
    </div>

    <div v-show="!show">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>招聘信息</legend>
        </fieldset>
        <form class="layui-form" >
            <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-inline" style="width: 500px;">
                    <input name="title" class="layui-input" v-model="recruitinfo.title">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">招聘类别</label>
                <div class="layui-input-inline">
                    <select name="type" lay-filter="type" v-model="recruitinfo.type" lay-search>
                        <option value="">选择招聘类别</option>
                        <option value="1">实习招聘</option>
                        <option value="2">就业招聘</option>
                    </select>
                </div>
                <label class="layui-form-label">岗位类别</label>
                <div class="layui-input-inline">
                    <select name="positiontype" lay-filter="positionType" v-model="recruitinfo.positiontype" lay-search>
                        <option value="">选择岗位</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">工作城市</label>
                <div class="layui-input-inline">
                    <input name="workingcity" class="layui-input" v-model="recruitinfo.workingcity">
                </div>
                <label class="layui-form-label">起薪</label>
                <div class="layui-input-inline">
                    <input name="salaryllimit" class="layui-input" v-model="recruitinfo.salaryllimit">
                </div>
            </div>
            <%--<div class="layui-form-item">--%>
            <%--<label class="layui-form-label">工作内容</label>--%>
            <%--<div class="layui-input-block">--%>
            <%--<input name="job" class="layui-input" v-model="recruitinfo.job">--%>
            <%--&lt;%&ndash;<textarea id="ta_ckeditor" class="ckeditor my-math" cols="20" rows="2" style="overflow:auto"></textarea>&ndash;%&gt;--%>
            <%--</div>--%>
            <%--</div>--%>
            <div class="layui-form-item">
                <label class="layui-form-label">工作内容</label>
                <div class="layui-input-inline">
                    <textarea type="text" name="job" class="layui-input" v-model="recruitinfo.job"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">其它说明</label>
                <div class="layui-input-inline">
                    <textarea type="text" name="comment" class="layui-input" v-model="recruitinfo.comment"></textarea>
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">工作环境</label>
                <div class="layui-input-inline">
                    <img src="" id="showWorkingPic" style="height: 100px;width: 100px">
                    <input type="file" name="fileUp" id="workingpic" class="layui-upload-file">
                </div>
            </div>
            <%--<div class="layui-form-item layui-form-text">--%>
            <%--<label class="layui-form-label">其他说明</label>--%>
            <%--<div class="layui-input-block">--%>
            <%--<input name="comment" class="layui-input" v-model="recruitinfo.comment">--%>
            <%--</div>--%>
            <%--</div>--%>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">招聘人数</label>
                <div class="layui-input-inline">
                    <input name="recruitnum" class="layui-input" v-model="recruitinfo.recruitnum">
                </div>
                <label class="layui-form-label">联系人</label>
                <div class="layui-input-inline">
                    <input name="recruitnum" class="layui-input" v-model="recruitinfo.contactperson">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">联系电话</label>
                <div class="layui-input-inline">
                    <input name="recruitnum" class="layui-input" v-model="recruitinfo.phone">
                </div>
                <label class="layui-form-label">联系邮箱</label>
                <div class="layui-input-inline">
                    <input name="recruitnum" class="layui-input" v-model="recruitinfo.email">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" class="layui-btn" @click="saveOrUpdate" value="提交">
                    <input type="button" class="layui-btn" @click="temporarilySaved" value="暂存">
                    <input type="button" class="layui-btn" @click="reload" value="返回">
                </div>
            </div>
        </form>
    </div>

</div>
<script src="../../static/common/axios.min.js"></script>
<script src="../../static/common/vue.min.js"></script>
<script src="../../static/common/layui/layui.js"></script>
<script src="../../static/js/layuiModulesEX/common.js"></script>
<script src="../../static/js/teacher/recruitInfos.js"></script>
<script>
    var publisherid = ${sessionScope.currentUser.getId()};
    var positionTypes = [];//所有岗位信息
    var teacher={};
    axios.get('/teacherInfo/findOneDetail/'+publisherid)
        .then(function (response) {
//            console.log(response.data.data);
            teacher = response.data.data.teacherInfo;
        })
        .catch(function (msg) {
            console.log(msg);
        });
</script>
<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    <tr>
        <%--<td><input  type="checkbox" lay-skin="primary"></td>--%>
        <%--招聘类型--%>
        {{# if(item.type == ""){ }}
        <td>-</td>
        {{# }; }}
        {{# if(item.type == 1){ }}
        <td>实习</td>
        {{# }; }}
        {{# if(item.type == 2){ }}
        <td>就业</td>
        {{# }; }}

        <td>{{ item.title || "-" }}</td>
        <td>{{ positionTypes[item.positiontype]}}</td>
        <td>{{ item.recruitnum || "-"}}</td>

        {{# if(item.state == ""){ }}
        <td>-</td>
        {{# }; }}
        {{# if(item.state == 1){ }}
        <td>未提交</td>
        {{# }; }}
        {{# if(item.state == 2){ }}
        <td>待审核</td>
        {{# }; }}
        {{# if(item.state == 3){ }}
        <td>审核通过</td>
        {{# }; }}
        {{# if(item.state == 4){ }}
        <td>审核不通过</td>
        {{# }; }}
        {{# if(item.publishdate == null){ }}
        <td>-</td>
        {{# }; }}
        {{# if(item.publishdate != null){ }}
        {{# var time = getYearMonthDate(item.publishdate); }}
        <td>{{ time || "-" }}</td>
        {{# }; }}

        <td>
            <a href="javascript:;" data-id="{{item.id}}" data-opt="detail"
               class="layui-btn layui-btn-mini">详情</a>
            {{# if(item.publisherid==teacher.userid&&(item.state==1||item.state==4)){ }}
            <a href="javascript:;" target="_self" data-id="{{item.id}}" data-opt="more"
               class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
            {{# }; }}
            <%--<a href="javascript:;"   data-opt="edit" class9="layui-btn layui-btn-mini">编辑</a>--%>
            {{# if(item.publisherid==teacher.userid){ }}
            <a href="javascript:;" data-opt="delete" data-id="{{item.id}}" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
            {{# }; }}
        </td>
    </tr>
    {{# }); }}
</script>

</body>
</html>
